Web Hooks

Web Hooks

This API supports some events to present with web hooks.

Visit here to see all events.

How does it work?

When an event enqueued and completed, this API send a request as your pre-defined request.

How to use

Create a webhook with Posting to v2.1/hooks and add request definitions inside a hook object.

Example how to add a hook:

POST | v2.1/hooks/Auth_Registered

Request:

{
  "isActive": true,
  "requests": [
    {
      "url": "https://myfirstdomain.com/register",
      "method": "POST"
    },
    {
      "url": "https://myseconddomain.com/register",
      "method": "GET"
    }
  ]
}

Response:

{
  "success": true,
  "data": {
    "id": "f3848b0d-1e28-4a9f-ac51-6e80cf369e36",
    "apiKey": "SOME_API_KEY",
    "key": "Auth_Registered",
    "isActive": true,
    "createdAt": "2020-01-06T16:49:05.963992",
    "modifiedAt": "2020-01-06T16:49:05.965819",
    "hookRequests": [
      {
        "id": "3e88a435-3396-4285-b07d-8ccd1bf2051e",
        "hookId": "f3848b0d-1e28-4a9f-ac51-6e80cf369e36",
        "url": "https://myfirstdomain.com/register",
        "method": "POST",
        "createdAt": "2020-01-06T16:49:05.97328",
        "modifiedAt": "2020-01-06T16:49:05.97441"
      },
      {
        "id": "9c508859-dfbb-4466-90ba-51c6e401d3f1,
        "hookId": "f3848b0d-1e28-4a9f-ac51-6e80cf369e36",
        "url": "https://myseconddomain.com/register",
        "method": "GET",
        "createdAt": "2020-01-06T16:49:05.97328",
        "modifiedAt": "2020-01-06T16:49:05.97441"
      }
    ]
  }
}

It's ready to use. When Auth_Registered event is triggered, 2 of your request definition will be executed with same payload with related endpoint with event._